﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;

namespace CaltechSoft.Service.SearchCriteria
{
    public class CertificateSearchCriteria
    {
        public string CustomerName { get; set; }
        public int? CustomerId { get; set; }
        public string SerialNumber { get; set; }
        public string CertificateNumber { get; set; }
        public string WorkOrderNo { get; set; }
        public string ModelNumber { get; set; }
        public string Username { get; set; }

        private readonly IDictionary<string, SearchSortItem> _sortItems;
        public IEnumerable<SearchSortItem> SortItems
        {
            get { return _sortItems.Values; }
        }

        public CertificateSearchCriteria()
        {
            _sortItems = new Dictionary<string, SearchSortItem>();
        }

        public CertificateSearchCriteria AddSortOrder(string field, SortOrder order)
        {
            if (!_sortItems.ContainsKey(field)) _sortItems.Add(field, new SearchSortItem(field, order));
            return this;
        }
    }

}
